﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Model.ProductType>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Sửa đối tượng
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% if (ViewData["MessageInfo"] == null)
       { %>
    <%using (Html.BeginForm("Edit", "ProductType", FormMethod.Post, new { id = "adminForm" }))
      { %>
    <fieldset>
        <legend>Sửa đối tượng</legend><font color="red">*</font> là trường bắt
        buộc phải nhập.
        <table width="100%" class="admintable">
            <body>
                <tr>
                    <td class="key">
                        Mã đối tượng(<font color="red">*</font>)
                    </td>
                    <td>
                        <%=Html.Encode(Model.ID)%>
                    </td>
                </tr>
                <tr>
                    <td class="key">
                        Tên đối tượng (<font color="red">*</font>)
                    </td>
                    <td>
                        <%=Html.TextBox("Name", Model.Name, new { @class = "required", style = "width:400px" })%>
                    </td>
                </tr>
                <tr>
                    <td class="key">
                        Mô tả
                    </td>
                    <td>
                        <%=Html.TextArea("Description", Model.Description, new { rows = 15, cols = 50, style = "width: 770px"})%>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <input type="submit" id="btnsubmit" name="btnsubmit" value="Lưu" /><input type="reset"
                            id="btnreset" name="btnreset" value="Nhập lại" />
                    </td>
                </tr>
            </body>
        </table>
    </fieldset>
    <%} %>

    <script type="text/javascript">
        $(document).ready(function() {
            $("#adminForm").validate({
                rules: {
                    Name: "required"
                },
                messages: {
                    Name: "Trường này là bắt buộc, vui lòng nhập dữ liệu!"
                }
            });
        });
        tinyMCE.init({
            mode: "textareas",
            theme: "advanced",
            plugins: "paste,imagemanager",
            theme_advanced_buttons1: "pastetext,separator,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink,insertimage",
            theme_advanced_buttons2: "",
            theme_advanced_buttons3: "",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "bottom",
            paste_use_dialog: false,
            paste_auto_cleanup_on_paste: true,
            paste_convert_headers_to_strong: false,
            paste_strip_class_attributes: "all",
            paste_remove_spans: true,
            paste_remove_styles: true
        });  
    </script>

    <%} %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Toolbar" runat="server">
<%=Html.Toolbar("Thêm mới","/ProductType/Create","new") %>
<%=Html.Toolbar("Xóa", string.Format("/ProductType/Delete/{0}", Model.ID), "delete")%>
<%=Html.Toolbar("Quay lại", "/ProductType", "back")%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
    Sửa đối tượng
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Message" runat="server">
<%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
